/**
 * Created by 春旺 on 2017/3/21.
 */
//******************************************************************************************************
// WinPercentage.java      Java   Foundations
//
// Demonstrates use of a while loop for input validation.
//*******************************************************************************************************

import java .util.Scanner;
import  java.text.NumberFormat;

public class WinPerentage
{
    //-----------------------------------------------------------------------------------------------------
    //  Computes the percentage of games won by team.
    //------------------------------------------------------------------------------------------------------
    public static void main(String[] args)
    {
        final int NUM_GAMES = 12;
        int won;
        double ratio;

        Scanner scan = new Scanner(System.in);

        won = scan.nextInt();

        while (won < 0 || won > NUM_GAMES);
        {
            System.out.print("Invalid input . please reenter: ");
            won = scan.nextInt();
        }

        ratio = (double)won / NUM_GAMES;

        NumberFormat fmt = NumberFormat.getPercentInstance()
                ;

        System.out.println();
        System.out.println("Winning percentage: " + fmt.format(ratio));

    }
}
